--// vim:ts=4:sw=4:noet
--// kick.lua -- kick user if he send http:// in private message

dcpp:setListener( "pm", "kick",
	function( hub, user, text )	
		if not user:isOp() and not user:msgHandled( "http://" )  then
			local s = string.lower( text )
			if string.find( s, "http://" ) then				
				victimnick = user:getNick()
				hub:sendHubMsg("$Kick "..victimnick.."|") -- send kick message for hub
				hub:injectPrivMsgFmt( victimnick, hub:getOwnNick(), text )
				user:setMsgHandled( "http://" )
				return 1
			end
		end
	end
)

DC():PrintDebug( "  ** Loaded kick.lua **" )